<?php
$page_title="Manage Events Registrations ";
	include("includes/header.php");
?>
<?


?>
<?if($_GET["mode"]=="view") { ?>
<?

$query="select *,DATE_FORMAT(dob,'%d-%m-%Y') as dob1 from bkitc_event_registration R JOIN bkit_news E on news_id=R.event_id and reg_id=".$_GET["reg_id"];
$event_info = @array_pop(qry_data($query." order by reg_id desc"));

?>
<div class="fleft">
<ul class="subMenu">

<li style="width:150px"><a href="?">Back to Registrations List </a></li>
</ul>
</div>
<div class="cleardiv"></div>
<div class="break"></div>


<div class="break"></div>
<b>Event Information :</b>
<?if($_GET["mode"]==1) { ?>
<div class="msgBox">You have successfully registered for the following event.<p> You will be notified once the registration is confirmed.</p></div>
<? } ?>
<pre class="event_info">
Name : <?=$event_info["news_title"]?><br/>
Date : <?=$event_info["news_date"]?><br/>
Event City : <?=$event_info["event_city"]?><br/>
Address & Location : <br/><?=$event_info["event_address"]?><br/>
</pre>


 <table id="Regform" border="0" cellspacing="3" cellpadding="2" width="50%" >

    <tbody>
	<tr><td colspan="2" class="section_head">Registrant Information</td></tr>
      <tr>

        <td class="frmLabel">Full Name&nbsp;</td>

        <td>
        	<?=$event_info["full_name"]?>  	
        </td>

      </tr>
  <tr>

        <td class="frmLabel">Gender &nbsp;</td>

        <td>
        
		<?=$event_info["gender"]==1?"Brother":"Sister"?>
        
        </td>

      </tr>
     

	
	<tr><td  class="frmLabel" valign="top">Mailing /Contact Address&nbsp;</td><td>
	<?=$event_info["contact_address"]?>
	</td></tr>
	<tr><td class="frmLabel">City *</td><td><?=$event_info["reg_city"]?></td></tr>
	<tr><td class="frmLabel">State *</td><td><?=$event_info["reg_state"]?></td></tr>
	<tr><td class="frmLabel">Country</td><td><?=$event_info["reg_country"]?></td></tr></td></tr>

 <tr>
       <td class="frmLabel">Pin Code&nbsp;</td>
        <td>
             <?=$event_info["reg_zip"]?>
         </td>
</tr>



	<tr><td colspan="2" class="section_head">Contact Information</td></tr>
      <tr><td class="frmLabel">Telephone No (inc STD code)&nbsp;</td>
        <td> <?=$event_info["reg_phone"]?></td>
     </tr>
      <tr>

        <td class="frmLabel">Cell
phone / Mobile No</td>

               <td> <?=$event_info["reg_mobile"]?></td>

      </tr>

      <tr>

        <td class="frmLabel">Email
address&nbsp; *</td>

     

               <td> <?=$event_info["reg_email"]?></td>
        

      

      </tr>

     	
      <tr>

        <td class="frmLabel" valign="top"  >Notes from Registrant
	
	</td>
  <td> <?=$event_info["reg_notes"]?></td>
      </tr>

    </tbody>
  </table>


<?} else {?>
<?
$query="select * from bkitc_event_registration R JOIN bkit_news E on news_id=R.event_id ";
if($_GET["event_id"]>0) $query=$query. " where R.event_id=".$_GET["event_id"];
$event_list = qry_data($query." order by reg_id desc");	

$query="select * from bkit_news where rec_status>=1";
$eventfulllist = qry_data($query." order by news_id desc");

?>
<div class="break"></div>
<table celpadding="0" cellspacing="0" width="100%"  class="section_panel">

					<tr>
						<td >
							
							<div class="fleft bold" style="margin-top:4px;" >Filter by Event  :</div>
							<div class="fleft bold" style="width:50px;text-align:right;margin-right:6px;margin-top:4px;">
							
							<select class="selectbox"  style="width:600px" name="event_id" id="event_id" onchange="javascript:location.href='?event_id=' + this.value;">
							<option value="0">--- Select Event ---</option>
							<?foreach($eventfulllist as $i=>$event) { ?>
							<option value="<?=$event["news_id"]?>"><?=$event["news_title"]?></option>
							
							<? } ?>
							</select>
							
							 </div>
							
							
							
						</td>
						
					</tr>
					
				</table>
<table width="100%" >
	<tr>
	<td valign="top">
		
	<table   class="table_panel" width="100%"  cellspacing="0" cellpadding="4">
	<tr  align="left">
	<th width="5">S.No</th>

	<th style="width:120px">Event Name</th>
	<th>Event Date</th>
	<th >Name </th>
	<th>Registered Date</th>
	<th>Status</th>
	<th >View</th>
	</tr>
	<? foreach($event_list as $i=>$event_reg) {?>

	<tr <?if($i%2==0) echo 'class="white_bg"'; else echo 'class="grey_bg"' ?>>
	<td><?=$i+1;?></td>

	<td><a href="edit_news.php?news_id=<?=$event_reg["news_id"]?>&mode=edit"><?=$event_reg["news_title"];?><a/></td>
	<td><?=$event_reg["news_date"];?></td>
	<td><?=$event_reg["full_name"];?></td>
	<td><?=$event_reg["reg_date"];?></td>
	<td><?if($event_reg["reg_status"]==0) echo "Open"; else echo "Confirmed";?></td>
	<td><a href="event_reg_list.php?reg_id=<?=$event_reg["reg_id"]?>&mode=view">Click to view details</a></td>
		
	</tr>
	
	<? } ?>
	</table>
	
	</td>
	</tr>
	
	</table>

<? } ?>
<?php include("includes/footer.php"); ?>

